package walkera.cn.bean;

import android.content.Context;
import android.graphics.Rect;
import android.view.View;

import androidx.recyclerview.widget.RecyclerView;

import com.wk.smarthome.R;


/**
 * RecyclerView 的辅助类。 设置 item之间的间隔
 */

public class MarginDecoration extends RecyclerView.ItemDecoration
{


    private int margin;
    public MarginDecoration(Context context)
    {
        margin = context.getResources().getDimensionPixelSize(R.dimen.aivin_item_margin);
    }

    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state)
    {
        super.getItemOffsets(outRect, view, parent, state);
        outRect.set(0, margin, margin, 0);
    }
}
